package cookinmaddy.database.spod;

/**
 * ...
 * @author Yog
 */

 
import cookinmaddy.model.Recipe;
import php.Lib;
 
class DBRecipe extends php.db.Object
{
	
	public var value : Recipe;
	
	public var rec_id : Int;
	public var rec_name : String;
	static var TABLE_NAME = "recipe";
	static var TABLE_IDS = ["rec_id"];
	static var PRIVATE_FIELDS = ["value"];
	
	public static var DROP_REQUEST = "drop table " + TABLE_NAME + ";";	
	
	public static var CREATION_REQUEST_V1 = "create table " + TABLE_NAME + " " +
	"( " +
		"rec_id integer autoincrement not null primary key ," +
		"rec_name varchar(50) not null" +
	");";
	public static var INITIALIZATION_REQUEST_V1 = "insert into " + TABLE_NAME + " " +
	"(" +
		"rec_name" +
	") VALUES (" + 
		"'poulet patate' " + 
	");";
	
	public static var manager = new DBRecipeManager();
}